/*
 * Copyright (c) 2010. Dylan Schell.
 */

package nl.xs4all.dylanschell.deckprinter.model;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.Serializable;
import java.util.UUID;

public class CardInDeck implements Serializable
{
    private static final long serialVersionUID = 1L;

    private final UUID id;
    private int quantity;
    private String name;

    public CardInDeck(@Nonnull String name, int quantity, @Nullable UUID cardId)
    {
        this.name = name;
        this.quantity = quantity;
        this.id = cardId;
    }

    public CardInDeck(@Nonnull CardInDeck source)
    {
        this.name = source.name;
        this.quantity = source.quantity;
        this.id = source.id;
    }

    public int getQuantity()
    {
        return quantity;
    }

    @Nullable
    public UUID getId()
    {
        return id;
    }

    @Nonnull
    public String getName()
    {
        return name;
    }

    public boolean isBasicLand()
    {
        return "Island".equals(name) || "Mountain".equals(name) || "Plains".equals(name) || "Swamp".equals(name) || "Forest".equals(name);
    }

    public void setQuantity(int quantity)
    {
        this.quantity = quantity;
    }

    public void setName(String name)
    {
        this.name = name;
    }
}
